package org.example.c4;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.LongAccumulator;

/**
 * @author liu-rui
 * @date 2020/6/9 下午2:49
 * @description
 *源码分析LongAccumulator
 * @since
 */
@Slf4j
public class Demo11 {
    public static void main(String[] args) {
        //重点研究以下四个方法
        LongAccumulator accumulator = new LongAccumulator((a, b) -> a + b, 0);


        accumulator.accumulate(10);
        accumulator.get();
        accumulator.reset();
    }
}
